﻿{{~ dto = entity_type + "Dto" ~}}
{{~ query_dto = entity_type + "QueryDto" ~}}
{{~ for using_item in usings ~}}
using {{ using_item }};
{{~ end ~}}

namespace {{ namespace }}
{
    public interface {{ class_name }}: IAppServices<{{entity_type}}>
    {
        /// <summary>
        /// 创建一个新实体
        /// </summary>
        /// <param name="entity">要创建的实体</param>
        /// <returns>创建后的实体</returns>
        {{ return_type }} Create({{ entity_type }} entity);

        /// <summary>
        /// 根据 ID 获取实体
        /// </summary>
        /// <param name="id">实体的唯一标识</param>
        /// <returns>获取的实体</returns>
        {{ return_type }} GetById({{ id_type }} id);

        /// <summary>
        /// 获取所有实体
        /// </summary>
        /// <returns>所有实体的列表</returns>
        PageResponse<{{return_type}}> GetPageList({{ query_dto }} query);

        /// <summary>
        /// 更新一个已有的实体
        /// </summary>
        /// <param name="entity">更新后的实体</param>
        /// <returns>更新后的实体</returns>
        bool Update({{ entity_type }} entity);

        /// <summary>
        /// 根据 ID 删除实体
        /// </summary>
        /// <param name="id">要删除的实体的唯一标识</param>
        /// <returns>操作是否成功</returns>
        bool Delete(params {{ id_type }}[] key);
    }
}
